package com.xzit.tmms.service.user.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xzit.tmms.bean.user.User;
import com.xzit.tmms.common.exception.ServiceException;
import com.xzit.tmms.mapper.user.UserMapper;
import com.xzit.tmms.service.user.MyService;
@Service("myService")
public class MyServiceImpl implements MyService{
     
	@Resource
	private UserMapper userMapper;

	@Override
	public User getMyPwdById(Integer userId) throws ServiceException {
		try {
			return userMapper.getById(userId);
		} catch (Exception e) {
			throw new ServiceException(e);
		}
	}

	@Override
	public void updateMyPwd(User user) throws ServiceException {
		try {
			userMapper.update(user);
		} catch (Exception e) {
			throw new ServiceException("修改失败！");
		}
		
	}

}
